package cn.momoshenchi.service;

import cn.momoshenchi.pojo.Article;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;

import java.io.IOException;
import java.util.List;

/**
 *
 */
public interface ArticleService extends IService<Article> {

    /**
     * 对title和content字段进行模糊查询
     * @param keyword
     * @return
     */
    List<Article> search(String keyword);

    /**
     * 添加文章同时加入es
     * @param article
     */
    void insertWithEs(Article article) throws IOException;

    /**
     * 批量添加文章同时加入es
     * @param article
     */
    void insertListWithEs(List<Article> article) throws IOException;
}
